package com.hpeu_12.day1224;

import java.util.Scanner;

public class home {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年：");
        int year = scanner.nextInt();
        System.out.println("请输入月：");
        int month = scanner.nextInt();
        System.out.println("请输入日：");
        int day = scanner.nextInt();
        boolean isRun = false;
        if((year % 4 == 0 && year % 100 !=0 ) || (year % 400 == 0)){
            isRun = true;
        }
       //定义一个变量来保存天数
        int sumDays = 0;
        switch (month){
            case 12: sumDays += 30;
            case 11: sumDays +=31;
            case 10:sumDays += 30;
            case 9:sumDays += 31;
            case 8:sumDays += 31;
            case 7:sumDays += 30;
            case 6:sumDays += 31;
            case 5:sumDays += 30;
            case 4:sumDays += 31;
            case 3:
                if (isRun){
                    sumDays +=29;
                }else {
                    sumDays +=28;
                }
            case 2:sumDays += 31;
            case 1:sumDays += day;
        }
        System.out.println( "今天是："+year+"的第"+sumDays+"天");

	}

}
